import request from '@/store/request'

/**
 * 列表查询接口
 * @param params
 */
export function loadImageTextDatas(params) {
  return request({
    url: 'image/text/list',
    method: 'get',
    dataType: 'json',
    params: params
  })
}


/**
 * 详情查询接口
 * @param id
 */
export function loadImageTextDetail(id) {
  return request({
    url: 'image/text/detail/' + id,
    method: 'get',
    dataType: 'json'
  })
}

export function addImageText(params) {
  return request({
    url: 'image/text/add',
    method: 'post',
    data: params,
    dataType: 'json'
  })
}

export function editImageText(params) {
  return request({
    url: 'image/text/edit',
    method: 'post',
    data: params,
    dataType: 'json'
  })
}

export function deleteImageText(imageTextId) {
  return request({
    url: 'image/text/delete/'+imageTextId,
    method: 'post',
    dataType: 'json'
  })
}


export function modifyStatus(imageTextId,status) {
  return request({
    url: 'image/text/edit/status',
    method: 'post',
    data: {
      id: imageTextId,
      status: status
    },
    dataType: 'json'
  })
}

export function topStatus(imageTextId) {
  return request({
    url: 'image/text/top/status/'+imageTextId,
    method: 'get',
    dataType: 'json'
  })
}
